const {
  DataTypes
} = require('sequelize');

module.exports = sequelize => {
  const attributes = {
    id: {
      type: DataTypes.INTEGER(20).UNSIGNED.ZEROFILL,
      allowNull: false,
      defaultValue: null,
      primaryKey: true,
      autoIncrement: true,
      comment: null,
      field: "id"
    },
    fromid: {
      type: DataTypes.STRING(20),
      allowNull: true,
      defaultValue: null,
      primaryKey: false,
      autoIncrement: false,
      comment: null,
      field: "fromid"
    },
    fromtitle: {
      type: DataTypes.STRING(255),
      allowNull: true,
      defaultValue: null,
      primaryKey: false,
      autoIncrement: false,
      comment: null,
      field: "fromtitle"
    },
    group_id: {
      type: DataTypes.INTEGER(11),
      allowNull: true,
      defaultValue: null,
      primaryKey: false,
      autoIncrement: false,
      comment: null,
      field: "group_id"
    },
    categoryId: {
      type: DataTypes.INTEGER(10),
      allowNull: true,
      defaultValue: null,
      primaryKey: false,
      autoIncrement: false,
      comment: null,
      field: "categoryId"
    },
    category: {
      type: DataTypes.STRING(255),
      allowNull: true,
      defaultValue: null,
      primaryKey: false,
      autoIncrement: false,
      comment: null,
      field: "category"
    },
    group_name: {
      type: DataTypes.STRING(255),
      allowNull: true,
      defaultValue: null,
      primaryKey: false,
      autoIncrement: false,
      comment: null,
      field: "group_name"
    },
    content: {
      type: DataTypes.TEXT,
      allowNull: true,
      defaultValue: null,
      primaryKey: false,
      autoIncrement: false,
      comment: null,
      field: "content"
    },
    user_id: {
      type: DataTypes.INTEGER(10),
      allowNull: true,
      defaultValue: null,
      primaryKey: false,
      autoIncrement: false,
      comment: null,
      field: "user_id"
    },
    author: {
      type: DataTypes.STRING(100),
      allowNull: true,
      defaultValue: null,
      primaryKey: false,
      autoIncrement: false,
      comment: null,
      field: "author"
    },
    like: {
      type: DataTypes.INTEGER(10).UNSIGNED.ZEROFILL,
      allowNull: true,
      defaultValue: "0000000000",
      primaryKey: false,
      autoIncrement: false,
      comment: null,
      field: "like"
    },
    collect: {
      type: DataTypes.INTEGER(10).UNSIGNED.ZEROFILL,
      allowNull: true,
      defaultValue: "0000000000",
      primaryKey: false,
      autoIncrement: false,
      comment: null,
      field: "collect"
    },
    tagId: {
      type: DataTypes.STRING(255),
      allowNull: true,
      defaultValue: "[]",
      primaryKey: false,
      autoIncrement: false,
      comment: null,
      field: "tagId"
    },
    tag: {
      type: DataTypes.STRING(255),
      allowNull: true,
      defaultValue: "[]",
      primaryKey: false,
      autoIncrement: false,
      comment: null,
      field: "tag"
    },
    status: {
      type: DataTypes.BIGINT,
      allowNull: true,
      defaultValue: "1",
      primaryKey: false,
      autoIncrement: false,
      comment: null,
      field: "status"
    },
    add_time: {
      type: DataTypes.DATE,
      allowNull: true,
      defaultValue: null,
      primaryKey: false,
      autoIncrement: false,
      comment: null,
      field: "add_time"
    }
  };
  const options = {
    tableName: "sentence",
    comment: "",
    indexes: []
  };
  const SentenceModel = sequelize.define("sentence_model", attributes, options);
  return SentenceModel;
};